﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Media.Imaging;

namespace MedVis
{
    public class MyImageObject
    {
        private Image image = null;
        private BitmapImage myBitmapImage = null;
        private int width = 0;
        private int heigth = 0;
        private string extinsion = "";
        //xml data
        public string path = "";
        public double offsetX = 0;
        public double offsetY = 0;
        public double rota = 0.0;

        public MyImageObject() { }

        public MyImageObject(string path)
        {
            //image.Source = new Uri(path);
            //image = new Image();
            this.path = path;
            //myBitmapImage = new BitmapImage();
            //myBitmapImage.BeginInit();
            //myBitmapImage.UriSource = new Uri(path);
            //myBitmapImage.EndInit();
            //image.Source = myBitmapImage;
            extinsion = path;
            //image.Width = myBitmapImage.PixelWidth; 
            //image.Height = myBitmapImage.PixelHeight;

            if (extinsion.Equals("jpg"))
            {
                width = getWidthJpg();
                heigth = getheigthJpg();
            }
            else
            {
                width = getWidthTiff();
                heigth = getheigthTiff();
            }
        }

        public BitmapImage getImage()
        {
            return myBitmapImage;
        }

        private int getWidthTiff()
        {
            return 10;
        }

        private int getWidthJpg()
        {
            return 10;
        }
        private int getheigthTiff()
        {
            return 10;
        }

        private int getheigthJpg()
        {
            return 10;
        }
    }
}
